<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/workbusiness/upper_tool.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/system/workbusiness/upper_tool.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                footer: "Foots",
                cnName: '刀具库',
                name: 'workbusiness/upper_tool',
                url: "/upper_tool/",
                sortName: "id"
            });
            const editFormFields = ref({"tool_name":"","knife_length":"","blade_length":"","reality_knife_length":"","reality_knife_width":"","reality_R":"","category":"","blade_width":"","knife_width":"","reality_knife_length":"","reality_blade_length":"","reality_blade_width":"","reality_knife_width":"","location":"","tool_handle":"","tool_collet":"","R":"","handle_type":"","collet_type":"","collet_length":"","extensions_type":"","extensions_length":"","tool_type":"","tool_length":"","reality_pairing_length":""});
            const editFormOptions = ref([[{"title":"工具名称","field":"tool_name","type":"text"},
                               {"title":"刀长","field":"knife_length","type":"text"},
                               {"title":"刀宽","field":"knife_width","type":"text"},
                               {"title":"类型","field":"category","type":"text"}],
                              [
                              {"title":"刀具长度","field":"tool_length","type":"decimal"},
                              {"title":"刀具类型","field":"tool_type","type":"text"},
                               {"title":"刀柄","field":"tool_handle","type":"text"},
                               {"title":"刀柄类型","field":"handle_type","type":"text"}
                              ],
                              [{"title":"实际刀长","field":"reality_knife_length","type":"decimal"},
                               {"title":"实际刀宽","field":"reality_knife_width","type":"decimal"},
                               {"title":"实际R角","field":"reality_R","type":"decimal"}
                               ,{"title":"实际对刀长度","field":"reality_pairing_length","type":"decimal"}],
                              [
                               {"title":"R角","field":"R","type":"decimal"},
                               {"title":"位置","field":"location","type":"text"},
                               {"title":"厂商代码","field":"vendor_code","type":"text"},
                               {"title":"刀具材料","field":"tool_materials","type":"text"},

                               ],
                              [{"title":"夹头类型","field":"collet_type","type":"text"},
                               {"title":"夹头长度","field":"collet_length","type":"decimal"},
                               {"title":"加长杆类型","field":"extensions_type","type":"text"},
                               {"title":"加长杆长度","field":"extensions_length","type":"decimal"}],
                              ]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'id',title:'id',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'program_seq',title:'序号',type:'string',width:120,align:'left',sort:true},
                       {field:'tool_name',title:'工具名称',type:'string',width:220,align:'left',sort:true},
                       
                       {field:'work_order_id',title:'工单',type:'int',bind:{ key:'工单',data:[]},width:120,require:true,align:'left'},

                       {field:'reality_knife_width',title:'实际刀径',type:'decimal',width:110,align:'left'},
                       {field:'reality_R',title:'实际刀尖圆角',type:'decimal',width:120,align:'left'},
                       {field:'reality_pairing_length',title:'实际对刀长度',type:'decimal',width:120,readonly:true,align:'left'},
                       {field:'accuracy',title:'精度',type:'decimal',width:110,align:'left'},
                       {field:'location',title:'位置',type:'int',width:110,align:'left'},
                       {field:'use_status',title:'使用状态',type:'int',bind:{key:'刀具使用状态',data:[]},width:120,require:true,align:'left'},


                       {field:'handle_type',title:'刀柄类型',type:'string',width:120,align:'left'},
                       {field:'collet_type',title:'夹头类型',type:'string',width:120,align:'left'},
                       {field:'extensions_type',title:'加长杆类型',type:'string',width:120,align:'left'},
                       {field:'tool_type',title:'刀具类型',type:'string',width:120,align:'left'},
                       {field:'category',title:'类型',type:'string',width:220,align:'left'},

                       {field:'knife_length',title:'刀长',type:'decimal',width:110,align:'left'},
                 
                       {field:'knife_width',title:'刀径',type:'decimal',width:110,align:'left'},
                       {field:'R',title:'刀尖圆角',type:'decimal',width:120,align:'left'},
                       {field:'collet_length',title:'夹头长度',type:'decimal',width:120,align:'left'},            
                       {field:'extensions_length',title:'加长杆长度',type:'decimal',width:120,align:'left'},
                       {field:'pairing_length',title:'对刀长度',type:'decimal',width:120,readonly:true,align:'left'},

                       {field:'reality_knife_length',title:'实际刀长',type:'decimal',width:110,align:'left'},
                      
                      
                       {field:'reality_collet_length',title:'实际夹头长度',type:'decimal',width:120,align:'left'},            
                       {field:'reality_extensions_length',title:'实际加长杆长度',type:'decimal',width:120,align:'left'},
                      
                       {field:'vendor_code',title:'厂商代码',type:'text',width:120,align:'left'},            
                       {field:'tool_materials',title:'刀具材料',type:'text',width:120,align:'left'},
                       {field:'process_start_time',title:'加工开始时间',type:'decimal',width:120,align:'left'},            
                       {field:'process_end_time',title:'加工完成时间',type:'decimal',width:120,align:'left'},
                       {field:'process_before_tool_width',title:'加工前刀径',type:'decimal',width:120,align:'left'},            
                       {field:'process_after_tool_width',title:'加工后刀径',type:'decimal',width:120,align:'left'},
                       {field:'process_before_tool_length',title:'加工前刀长',type:'decimal',width:120,align:'left'},            
                       {field:'process_after_tool_length',title:'加工后刀长',type:'decimal',width:120,align:'left'},
                       
                      ]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
